<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!--<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">-->
    <title>芜湖市数据开放服务平台</title>
    <!-- import Vue before Element -->
    <script src="https://unpkg.com/vue/dist/vue.js"></script>
    <!-- import JavaScript -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
</head>

<body id="uploadApply1" style="background-color: #ffffff">


    <div class="main-content min-height personal">

        <div class="right-content" style="position: relative;" id="app">

            <div class="v2per_textarea" style="margin-top: 20px;margin-left: 50px">
                <p class="v2per_card_row_text" style="line-height: 202px">test:</p>
                <textarea rows="" cols="" v-model="mytext"
                    style="width: 714px;height: 202px;margin-left: 29px;border-color: #797979;"></textarea>
            </div>
            <el-button type="primary" size="small" @click="sub()">
                &nbsp;&nbsp;&nbsp;提交&nbsp;&nbsp;&nbsp;
            </el-button>
            <div class="v2per_textarea" style="margin-top: 20px;margin-left: 50px">
                <p class="v2per_card_row_text" style="line-height: 202px">result:</p>
                <textarea rows="" cols="" v-model="text"
                    style="width: 714px;height: 202px;margin-left: 29px;border-color: #797979;"></textarea>
            </div>


        </div>
    </div>
    <div class="clear"></div>
    </div>
    <div class="float" style="height: 70px; overflow: hidden;background-position:center top;">
        <a data-toggle="modal" data-target="#myModal" class="wechart"></a>
        <div style="width:100px;height:100px;cursor:pointer;" id="totop" class="totop"></div>
    </div>





    <script>
        var app = new Vue({
            el: '#app',
            data() {
                return {
                    mytext: null,
                    text: null
                }
            },

            methods: {
                sub() {
                    this.text = null
                    let y = this.mytext.replace(new RegExp(/{\/\//, 'g'), '{\n\/\/')
                    const reg = new RegExp(/.+;\s+\/\/.+/, 'g')
                    const arr = y.match(reg)
                    console.log(arr);
                    if (arr != null) {
                        for (i = 0; i < arr.length; i++) {
                            const t = arr[i]
                            const s = t.lastIndexOf(';') + 1
                            const b = t.substring(s) + '\n' + t.substring(0, s)
                            y = y.replace(t, b);
                        }
                    }
                    this.text = y
                }
            },



        })
    </script>


</body>

</html>